package leetcode;

import java.util.Arrays;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * User:Mr.Du
 * Date:2022/3/1
 * Time:21:09
 */
public class 最长递增子序列 {
    public static void main(String[] args) {
        int[] arr = {1,3,5,4,7};
        System.out.println(lengthOfLIS(arr));
    }
    public static int lengthOfLIS(int[] nums) {
        int len = nums.length;
        int i = 0, j = 0, res = 0;
        while(j < len){
            if(j > 0 && nums[j - 1] >= nums[j]) i = j;
            j++;
            res = Math.max(res,j - i);
        }
        return res;

    }
}
